package com.aspose.cells;

class zabc extends zaba {
   protected int a(int var1) {
      return com.aspose.cells.b.a.zc.a(this.d, var1) - 1;
   }

   public void a(byte[] var1, int var2, int var3) {
      this.d = var1;
      if (var3 < 0) {
         this.a = var2 + 4;
         this.b = this.a + com.aspose.cells.b.a.zc.a(this.d, var2);
         this.c = this.b + 4;
      } else {
         this.a = var2;
         this.b = var3;
         this.c = this.b;
      }

   }

   public boolean h() {
      switch(this.d[this.a]) {
      case 1:
      case 2:
         this.a += 7;
         break;
      case 3:
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 33:
      case 34:
      case 35:
      case 38:
      case 39:
      case 40:
      case 41:
      case 46:
      case 47:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 62:
      case 63:
      case 65:
      case 66:
      case 67:
      case 70:
      case 71:
      case 72:
      case 73:
      case 78:
      case 79:
      case 80:
      case 81:
      case 82:
      case 83:
      case 84:
      case 85:
      case 86:
      case 87:
      case 88:
      case 89:
      case 94:
      case 95:
      case 97:
      case 98:
      case 99:
      case 102:
      case 103:
      case 104:
      case 105:
      case 110:
      case 111:
      case 112:
      case 113:
      case 114:
      case 115:
      case 116:
      case 117:
      case 118:
      case 119:
      case 120:
      case 121:
      default:
         if (!super.h()) {
            return false;
         }
         break;
      case 23:
         this.a += 3 + 2 * (com.aspose.cells.b.a.zc.e(this.d, this.a + 1) & '\uffff');
         break;
      case 32:
      case 64:
      case 96:
         this.i();
         this.a += 15;
         break;
      case 36:
      case 42:
      case 44:
      case 68:
      case 74:
      case 76:
      case 100:
      case 106:
      case 108:
         this.a += 7;
         break;
      case 37:
      case 43:
      case 45:
      case 69:
      case 75:
      case 77:
      case 101:
      case 107:
      case 109:
         this.a += 13;
         break;
      case 58:
      case 60:
      case 90:
      case 92:
      case 122:
      case 124:
         this.a += 9;
         break;
      case 59:
      case 61:
      case 91:
      case 93:
      case 123:
      case 125:
         this.a += 15;
      }

      return true;
   }

   public zaye a(zaay var1) {
      zaye var2;
      byte var3;
      switch(this.d[this.a]) {
      case 1:
      case 2:
      case 36:
      case 68:
      case 100:
         var2 = new zaye();
         var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 1));
         var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 5) & '\uffff' & 16383);
         if (var1.g()) {
            var3 = this.d[this.a + 6];
            if ((var3 & 255 & 128) != 0) {
               var2.a(false);
            }

            if ((var3 & 255 & 64) != 0) {
               var2.b(false);
            }
         }

         var2.t();
         this.a += 7;
         return var2;
      case 37:
      case 69:
      case 101:
         var2 = new zaye();
         var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 1));
         var2.c(com.aspose.cells.b.a.zc.a(this.d, this.a + 5));
         var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 9) & '\uffff' & 16383);
         var2.d(com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383);
         if (var1.g()) {
            var3 = this.d[this.a + 10];
            if ((var3 & 255 & 128) != 0) {
               var2.a(false);
            }

            if ((var3 & 255 & 64) != 0) {
               var2.b(false);
            }

            var3 = this.d[this.a + 12];
            if ((var3 & 255 & 128) != 0) {
               var2.c(false);
            }

            if ((var3 & 255 & 64) != 0) {
               var2.d(false);
            }
         }

         var2.s();
         var2.e(true);
         this.a += 13;
         return var2;
      case 44:
      case 76:
      case 108:
         var2 = new zaye();
         var3 = this.d[this.a + 6];
         if ((var3 & 255 & 128) != 0) {
            var2.a((com.aspose.cells.b.a.zc.a(this.d, this.a + 1) + var1.g) % 1048576);
            var2.a(false);
         } else {
            var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 1));
            var2.a(true);
         }

         if ((var3 & 255 & 64) != 0) {
            var2.b(((com.aspose.cells.b.a.zc.e(this.d, this.a + 5) & '\uffff' & 16383) + var1.h) % 16384);
            var2.b(false);
         } else {
            var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 5) & '\uffff' & 16383);
            var2.b(true);
         }

         var2.t();
         this.a += 7;
         return var2;
      case 45:
      case 77:
      case 109:
         var2 = new zaye();
         var3 = this.d[this.a + 10];
         if ((var3 & 255 & 128) != 0) {
            var2.a((com.aspose.cells.b.a.zc.a(this.d, this.a + 1) + var1.g) % 1048576);
            var2.a(false);
         } else {
            var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 1));
         }

         if ((var3 & 255 & 64) != 0) {
            var2.b(((com.aspose.cells.b.a.zc.e(this.d, this.a + 9) & '\uffff' & 16383) + var1.h) % 16384);
            var2.b(false);
         } else {
            var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 9) & '\uffff' & 16383);
         }

         var3 = this.d[this.a + 12];
         if ((var3 & 255 & 128) != 0) {
            var2.c((com.aspose.cells.b.a.zc.a(this.d, this.a + 5) + var1.g) % 1048576);
            var2.c(false);
         } else {
            var2.c(com.aspose.cells.b.a.zc.a(this.d, this.a + 5));
         }

         if ((var3 & 255 & 64) != 0) {
            var2.d(((com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383) + var1.h) % 16384);
            var2.d(false);
         } else {
            var2.d(com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383);
         }

         var2.s();
         var2.e(true);
         this.a += 13;
         return var2;
      case 58:
      case 90:
      case 122:
         var2 = new zaye();
         var2.a(var1.p.g.q().b(com.aspose.cells.b.a.zc.e(this.d, this.a + 1) & '\uffff'));
         var3 = this.d[this.a + 8];
         if ((var3 & 255 & 128) != 0) {
            if (!var1.j && var1.a != 1 && var1.a != 5) {
               var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 3));
               if (var1.g()) {
                  var2.a(false);
               }
            } else {
               var2.a((com.aspose.cells.b.a.zc.a(this.d, this.a + 3) + var1.g) % 1048576);
               var2.a(false);
            }
         } else {
            var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 3));
         }

         if ((var3 & 255 & 64) != 0) {
            if (!var1.j && var1.a != 1 && var1.a != 5) {
               var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 7) & '\uffff' & 16383);
               if (var1.g()) {
                  var2.b(false);
               }
            } else {
               var2.b(((com.aspose.cells.b.a.zc.e(this.d, this.a + 7) & '\uffff' & 16383) + var1.h) % 16384);
               var2.b(false);
            }
         } else {
            var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 7) & '\uffff' & 16383);
         }

         var2.t();
         this.a += 9;
         return var2;
      case 59:
      case 91:
      case 123:
         var2 = new zaye();
         var2.a(var1.p.g.q().b(com.aspose.cells.b.a.zc.e(this.d, this.a + 1) & '\uffff'));
         if (var1.a == 1) {
            var3 = this.d[this.a + 12];
            if ((var3 & 255 & 128) != 0) {
               var2.a((com.aspose.cells.b.a.zc.a(this.d, this.a + 3) + var1.g) % 1048576);
               var2.a(false);
            } else {
               var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 3));
            }

            if ((var3 & 255 & 64) != 0) {
               var2.b(((com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383) + var1.h) % 16384);
               var2.b(false);
            } else {
               var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383);
            }

            var3 = this.d[this.a + 14];
            if ((var3 & 255 & 128) != 0) {
               var2.c((com.aspose.cells.b.a.zc.a(this.d, this.a + 7) + var1.g) % 1048576);
               var2.c(false);
            } else {
               var2.c(com.aspose.cells.b.a.zc.a(this.d, this.a + 7));
            }

            if ((var3 & 255 & 64) != 0) {
               var2.d(((com.aspose.cells.b.a.zc.e(this.d, this.a + 13) & '\uffff' & 16383) + var1.h) % 256);
               var2.d(false);
            } else {
               var2.d(com.aspose.cells.b.a.zc.e(this.d, this.a + 13) & '\uffff' & 16383);
            }
         } else {
            var2.a(com.aspose.cells.b.a.zc.a(this.d, this.a + 3));
            var2.c(com.aspose.cells.b.a.zc.a(this.d, this.a + 7));
            var2.b(com.aspose.cells.b.a.zc.e(this.d, this.a + 11) & '\uffff' & 16383);
            var2.d(com.aspose.cells.b.a.zc.e(this.d, this.a + 13) & '\uffff' & 16383);
            if (var1.g()) {
               var3 = this.d[this.a + 12];
               if ((var3 & 255 & 128) != 0) {
                  var2.a(false);
               }

               if ((var3 & 255 & 64) != 0) {
                  var2.b(false);
               }

               var3 = this.d[this.a + 14];
               if ((var3 & 255 & 128) != 0) {
                  var2.c(false);
               }

               if ((var3 & 255 & 64) != 0) {
                  var2.d(false);
               }
            }
         }

         var2.s();
         var2.e(true);
         this.a += 15;
         return var2;
      default:
         return null;
      }
   }

   public String b() {
      int var1;
      String var2;
      switch(this.d[this.a]) {
      case 23:
         try {
            var1 = (com.aspose.cells.b.a.zc.e(this.d, this.a + 1) & '\uffff') * 2;
            var2 = Encoding.getUnicode().a(this.d, this.a + 3, var1);
            this.a += var1 + 3;
            return var2;
         } catch (Exception var4) {
            throw new CellsException(5, "Invalid formula[string node]");
         }
      case 32:
      case 64:
      case 96:
         switch(this.d[this.c]) {
         case 1:
            try {
               var1 = (com.aspose.cells.b.a.zc.e(this.d, this.c + 1) & '\uffff') * 2;
               var2 = Encoding.getUnicode().a(this.d, this.c + 3, var1);
               this.c += var1 + 3;
               return var2;
            } catch (Exception var3) {
               throw new CellsException(5, "Invalid formula[string node]");
            }
         }
      default:
         return null;
      }
   }

   public zyz b(zaay var1) {
      zyz var2;
      switch(this.d[this.a]) {
      case 42:
      case 74:
      case 106:
         var2 = zzf.a;
         this.a += 7;
         return var2;
      case 43:
      case 75:
      case 107:
         var2 = zzf.a;
         this.a += 13;
         return var2;
      case 60:
      case 92:
      case 124:
         var2 = zzf.a;
         this.a += 9;
         return var2;
      case 61:
      case 93:
      case 125:
         var2 = zzf.a;
         this.a += 15;
         return var2;
      default:
         return null;
      }
   }

   public zagu[][] a() {
      int var1 = com.aspose.cells.b.a.zc.a(this.d, this.c);
      this.c += 4;
      int var2 = com.aspose.cells.b.a.zc.a(this.d, this.c);
      this.c += 4;
      zagu[][] var3 = new zagu[var2][];

      for(int var4 = 0; var4 < var2; ++var4) {
         var3[var4] = new zagu[var1];

         for(int var5 = 0; var5 < var1; ++var5) {
            switch(this.d[this.c]) {
            case 0:
               var3[var4][var5] = new zyy(com.aspose.cells.b.a.zc.f(this.d, this.c + 1));
               this.c += 9;
               break;
            case 1:
               try {
                  int var6 = (com.aspose.cells.b.a.zc.e(this.d, this.c + 1) & '\uffff') * 2;
                  var3[var4][var5] = new zaam(Encoding.getUnicode().a(this.d, this.c + 3, var6));
                  this.c += var6 + 3;
                  break;
               } catch (Exception var7) {
                  throw new CellsException(5, "Invalid formula[string node]");
               }
            case 2:
               var3[var4][var5] = this.d[this.c + 1] != 0 ? zyx.a : zyw.a;
               this.c += 2;
               break;
            case 3:
            default:
               com.aspose.cells.a.c.zl.a("Unrecognized token in additional data: " + (this.d[this.c] & 255));
               break;
            case 4:
               var3[var4][var5] = zyz.a(this.d[this.c + 1]);
               this.c += 5;
            }
         }
      }

      this.a += 15;
      return var3;
   }

   private void i() {
      int var1 = com.aspose.cells.b.a.zc.a(this.d, this.c);
      this.c += 4;
      int var2 = com.aspose.cells.b.a.zc.a(this.d, this.c);
      this.c += 4;

      for(int var3 = 0; var3 < var2; ++var3) {
         for(int var4 = 0; var4 < var1; ++var4) {
            switch(this.d[this.c]) {
            case 0:
               this.c += 9;
               break;
            case 1:
               this.c += (com.aspose.cells.b.a.zc.e(this.d, this.c + 1) & '\uffff') * 2 + 3;
               break;
            case 2:
               this.c += 2;
               break;
            case 3:
            default:
               com.aspose.cells.a.c.zl.a("Unrecognized token in additional data: " + (this.d[this.c] & 255));
               break;
            case 4:
               this.c += 5;
            }
         }
      }

   }
}
